#include<iostream>
#include<cstdio>
#include<algorithm>
#include<string>
#include<fstream>
#include<cmath>
using namespace std;
struct AK{
	long long s,num;
}a[8005],b[8005];
bool cmp(AK x,AK y){
	return x.s<y.s;
}
long long n,q,m,x,v;
int main(){
	freopen("sort.in","r",stdin);
	freopen("sort.out","w",stdout);
	cin>>n>>q;
	for(int i=1;i<=n;i++){
		cin>>a[i].s;
		a[i].num=i;
	}
	for(int i=1;i<=q;i++){
		cin>>m>>x;
		if(m==1){
			cin>>v;
			a[x].s=v;
		}
		else{
			for(int i=1;i<=n;i++)
			b[i].s=a[i].s,b[i].num=a[i].num;
			sort(b+1,b+1+n,cmp);
			for(int i=1;i<=n;i++)
				if(b[i].num==x){
					cout<<i<<endl;
					break;
				}
		}
	}
	return 0;
}
